package cn.zhaoyan.serviceimpl;


import cn.zhaoyan.bean.User;
import cn.zhaoyan.dao.Userdao;
import cn.zhaoyan.daoimpl.UserDaoImpl;
import cn.zhaoyan.service.Userservice;

public class UserServiceImpl implements Userservice {

    Userdao dao = new UserDaoImpl();

    @Override
    public boolean queryServiceDl(User user) {
        User user1 = dao.userDaodl(user);
        if (user1!=null) {
            return true;
        }
        return false;
    }


    @Override
    public boolean queryService(User user) {
        User user1 = dao.userDao(user);
        if (user1==null){
            int regist = dao.regist(user);
            if (regist>0){
                return true;

            }else {

                return false;
            }
        }else {
            return false;
        }
    }
}
